package cn.qn.dto.security;

import cn.qn.moudle.security.Menu;
import cn.qn.moudle.security.Role;
import javax.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author Bryant
 */
@Data
public class MenuDTO implements Serializable,Comparable {
    private static final long serialVersionUID = 4196496383195358843L;
    private Integer id;
	private String name;
	private String url;
	private Integer parentId;
	private Integer status;
	private Integer priority;
	private String icon;
	List<Menu> children;
	private List<Role> roles;

	@Override
	public int compareTo(@NotNull Object o) {
		MenuDTO dto = (MenuDTO) o;
		return this.priority.compareTo(dto.getPriority());
	}
}
